package com.zhentao.day06;

public class ObjectTest {
  public static void main(String[] args) {


    ClassRoom classRoom = new ClassRoom() ;
    classRoom.kouHao = "云网时代";
    classRoom.name = "2406A";
    classRoom.count = 43 ;

    Student stu = new Student() ;
    stu.name = "赵佳轩";
    stu.age = 18 ;
    stu.sex = '男';
    stu.studyId = "201801010101";
    // stu.classRoom = classRoom ;


    /*Person per = new Person() ; // 0X0001

    per.name = "李四";
    per.age = 20 ;

    Person per1 = per ; // per1 的地址是 0X0001

    System.out.println("per == per1 = " + (per == per1));*/


    // 一 new 一堆
    // Person per = new Person();
    // Person per1 = new Person();
    //
    // System.out.println("per = " + per);
    // System.out.println("per1 = " + per1);
    // // 因为 new 关键字 实现的是将类的模板成成为对象, 并存储在堆空间当中。
    // // 每个 new 都会进行上述的操作, 所以两个对象地址不会相同。
    // // == 目前比较的是两个对象的地址, 所以返回值是 false
    // System.out.println("per == per1 = " + (per == per1)); // false


    // new Person().showInfo(); // 匿名初始化

  }
}

class Person{
  String name ;
  int age ;

  public void showInfo(){
    int a = 3 ;
    System.out.println("name = "+name+" \t age = "+age);
  }
}




